package com.base.cn.platform.os.service.manage.work;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 工作台接口
 *
 * @author s.li
 * @create 2018-04-13-10:45
 */
@FeignClient(name = BaseService.appName ,configuration = FeignAuthConfig.class)
public interface SysUserWorkBenchService extends BaseService {

    /**
     * 查询工作台数据列表
     * @param userId 用户ID
     * @return List<SysUserWorkBench>
     */
    @RequestMapping(contextPath + "/findUserWordFunctionList")
    List<Map<String,Object>> findUserWordFunctionList(@RequestParam("userId") BigDecimal userId);

    /**
     * 排序工作的权限
     * @param userId 用户ID
     * @param paramsList 排序数据内容
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/updateWorkFunctionSort")
    Map<String,Object> updateWorkFunctionSort(@RequestParam("userId") BigDecimal userId, @RequestBody List<Map<String, Object>> paramsList);

    /**
     * 获取未显示在工作上的权限列表
     * @param type 类型 provider运营支持，operate内容提供，prepare系统准备
     * @param userId 用户ID
     * @return 权限列表
     */
    @RequestMapping(contextPath + "/queryNotShowFunction")
    List<Map<String,Object>> queryNotShowFunction(@RequestParam("type") String type,
                                                  @RequestParam("userId") BigDecimal userId);

    /**
     * 添加工作台权限显示
     * @param userId 用户ID
     * @param functionIds 权限ID串
     * @param unSelectedIds 不显示的权限ID串
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/addUserWorkFunction")
    Map<String,Object> addUserWorkFunction(@RequestParam("userId") BigDecimal userId,
                                           @RequestParam("functionIds") String functionIds,
                                           @RequestParam("unSelectedIds") String unSelectedIds);
}
